/**
 * @see https://umijs.org/docs/max/access#access
 * */
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
  const { currentUser } = initialState ?? {};

  return {
    canAdmin: currentUser && currentUser.access === 'admin',
    canReadWelcome: true,
    canReadList: true,
    canReadLoginLog: true,
    canReadApiLog: true,
    canReadErrorLog: true,
    canReadUserManage: true,
    canReadPermissionManage: true,
    canReadMenuManage: true,
  };
}
